package sjtu.rfid.rri.services.io;

/**
 * This interface defines the Message Listener to receive notfication on
 * connection when there is any data available.
 * 
 * @author jinghao
 * 
 */
public interface MessageListener {

	/**
	 * receive message
	 * 
	 * @param buffer
	 *            result buffer
	 */
	void onMessage(byte[] buffer);

	/**
	 * Invoke when consumer connection is closed. Put closing work here, e.g,
	 * close the connection.
	 * 
	 * @param Consumer
	 */
	void onClosed(Consumer consumer);
}
